package ltd.dujiabao.springboot.service;

import ltd.dujiabao.springboot.fallback.HystrixServiceFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @author : DuJiabao
 * @Project : springcloud
 * @Time : 2021/5/22 19:33
 * @Desc :
 */
@Service
@FeignClient(value = "CLOUD-PROVIDER-HYSTRIX-PAYMENT", fallback = HystrixServiceFallback.class)
public interface HystrixService {
  @GetMapping("/hystrix/ok/{id}")
  String runsWell(@PathVariable("id") Integer id);

  @GetMapping("/hystrix/timeOut/{id}")
  String runsTimeOut(@PathVariable("id") Integer id);

  @GetMapping("/hystrix/exception/{id}")
  String runsException(@PathVariable("id") Integer id);
}
